class command:
    FRAME_HEADER = '3c'
    FRAME_TRAILER = '3e'

    def __init__(self):
        self.index = None  # 命令索引
        self.type = None  # 当前控制命令的类型
        self.cmd = None  # 命令
        self.data = None
        self.device_name = None  # 名字
        self.device_index = None  # 设备索引
        self.breed = None  # 品种
        self.age = None  # 年龄

    def get_cmd(self):
        return f"{self.FRAME_HEADER}{self.cmd}{self.data}{self.FRAME_TRAILER}"

    # def sit(self):
    #     return f"{self.name} 坐下了."
    #
    # def roll_over(self):
    #     return f"{self.name} 翻了个身."


# 创建一个 Dog 对象
# my_dog = command(name="旺财", breed="金毛寻回犬", age=3)

# 访问属性
# print(f"它的品种是 {my_dog.breed}")
# print(f"它今年 {my_dog.age} 岁")

# 调用方法
# print(my_dog.sit())
# print(my_dog.roll_over())

# print(my_dog.get_cmd())
